The Desktop Database
The Desktop Database
For quick access to the resources it needs, the Finder maintains a central
desktop database of information about the files and directories on a volume.
The Finder updates the database when applications are added, moved, renamed,
or deleted.
Normally, your application will not need to use the information in the desktop
database or to use Desktop Manager routines to manipulate it. Instead, your
application should let the Finder manipulate the desktop database and handle
such Desktop Manager tasks as launching applications when users
double-click icons, maintaining user comments associated with files, and
managing the icons used by applications.
Although there may be instances where you would like to gain access to the
desktop database by using Desktop Manager routines, you should never
change, add to, or remove any of this information.
IMPORTANT NOTE: Manipulating the desktop database is likely to wreak
havoc on your users' systems.
In case you should discover some important need to retrieve information from
the desktop database or even to change the desktop database from within your
application, Desktop Manager routines are provided for you to do so. Your
application probably will not ever need to use them however.
Much of the information in the desktop database comes from the
bundle resources for applications and other files on the volume. (See the
description of Finder Information in the Volume Catalog for a discussion on
setting the bundle bit of an application so that its bundled resources get stored
in the desktop database.) The desktop database contains all icon definitions and
their associated file types. It lists all the file types that each application can
open and all copies or versions of the application that's listed as the creator of
a file. The desktop database also lists the location of each application on the disk
and any comments that the user has added to the information windows for
desktop objects. The Desktop Manager provides a new set of routines that
lets your application retrieve this information from the desktop database.
These are described in Desktop Manager Routines.
The Finder maintains a desktop database for each volume with a capacity
greater than 2 MB. For most volumes, such as hard disks, the database is
stored on the volume itself. For read-only volumes-such as some compact
discs-that do not contain their own desktop database, the Desktop Manager
creates it and stores it in the System Folder of the boot drive.
Note: If you distribute read-only media, it is generally a good idea to
store on each volume both a desktop database (for users running System
7.0) and a Desktop file (for users running older versions of system
software). Create a desktop database on your master volume by pressing
Command-Option when booting your system with System 7.0. Then create a
Desktop file by pressing Command-Option and restarting your system with
version 6.0.
For compatibility with older versions of system software, the Finder keeps
the information for ejectable volumes with a capacity smaller than 2 MB in a
resource file instead of a database.
Although the Desktop Manager provides tools for both reading and changing
the desktop database, your application should not ordinarily change anything in
the database. You can read the database to retrieve information, such as the
icons defined by other applications.
Note: The desktop database does not store customized icons (that is, those
with resource IDs of -16455 described in Customized Icons ), so your
application can not retrieve them by using Desktop Manager routines.